<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var array1 = new Array(7);
			console.log(array1.length);//7
			var array2 = new Array(100,'abc',true);
			console.log(array2.length);//3
			//创建一个空数组
			var array = new Array();
			array[0] = '234';
			console.log(array);//['234']
			console.log(array.length);//1
			array[1] = false;
			console.log(array);//['234',false]
			console.log(array.length);//2
			
			var arr = new Array();
			//使用push和pop向数组里面放数据和拿数据
			arr.push('zhangsan')
			console.log(arr);// ['zhansgan']
			console.log(arr.length);//1
			arr.push(23)
			console.log(arr);// ['zhansgan',23]
			console.log(arr.length);//2
			arr.push(true)
			console.log(arr);// ['zhansgan',23,true]
			console.log(arr.length);//3
			console.log(arr[1]);//23
			
			console.log(arr.pop());//true
			console.log(arr);// ['zhansgan',23]
			console.log(arr.pop());//23
			console.log(arr);// ['zhansgan']
			
		</script>
	</body>
</html>